import { defineConfig, normalizePath } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import globImport from '@xyh19/rollup-plugin-glob-import'
import electron from '@xyh19/vite-plugin-electron'

const electronPlugin = electron({
  input: { appEntry: 'src/main/app.ts' },
  output: { sourcemapExcludeSources: true },
  plugins: [
    globImport()
  ]
})

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    globImport(),
    vue(),
    vueJsx({ transformOn: true, optimize: true, mergeProps: true }),
    electronPlugin
  ]
})
